﻿-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters 
-- command (Ctrl-Shift-M) to fill in the parameter 
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
USE [WarehouseManagement]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		AnhDQ
-- Create date: 3/16/2011
-- Description:	This stored procedure use to get an EmploymentType record
-- =============================================
ALTER PROCEDURE [SearchRole]
(
@RoleName NVARCHAR(50) = NULL
)
AS
BEGIN
	IF @RoleName IS NULL
		SET @RoleName = ''
	SELECT 
			r.RoleID
			, r.RoleCode
			, r.RoleName
			, r.BriefDescription
			, r.FullDescription
			, r.IsDelete
	FROM 
			[Role] r
	WHERE
		r.IsDelete = 0 AND r.RoleName LIKE '%' + @RoleName +'%'
END

/*
USE WarehouseManagement
GO
select * from Employee
EXEC [SearchEmployee] 
*/